Skip to main content
Version: 9

Behavior Tree Troubleshooting

Uncancellable Objective after using Repeat or RetryUntilSuccessful with an infinite cycle count

Problem: I put a -1 in the num_cycles port of Repeat (or num_attempts of RetryUntilSuccessful) and it deadlocked MoveIt Pro.

Solution: The Repeat and RetryUntilSuccessful decorators repeat the child up to N times within one of their ticks. When set to the appropriate condition infinitely (always-Successful for Repeat with num_cycles="-1", or always-Failure for RetryUntilSuccessful with num_attempts="-1"), the Objective server will get deadlocked.

Use RepeatUnlessFailureEachTick instead. It runs at most one child iteration per parent tick, so an infinite loop (num_cycles="-1", the default) cannot deadlock the tree even with synchronous always-successful children. It also supports a finite num_cycles cap, replacing both Repeat and the legacy KeepRunningUntilFailure in one decorator.

Deprecated decorators

Repeat, RetryUntilSuccessful, and KeepRunningUntilFailure are deprecated as of MoveIt Pro 9.3 and will be removed in 10.0. Existing Objectives keep working, and a one-shot deprecation warning is logged the first time the Objective Server registers Behaviors. The Behavior palette also marks each entry as [DEPRECATED]. Migrate to RepeatUnlessFailureEachTick. If you intentionally need the legacy within-tick loop semantics, use the explicit RepeatUnlessFailureWithinTick alias.